//
//  SIDButtonManager.m
//  reactsdk
//
//  Created by Валиева Анна Евгеньевна on 11.04.2024.
//

#import <React/RCTBridgeModule.h>

@interface RCT_EXTERN_MODULE(SIDModule, NSObject)

// Экспорт методов класса SIDModule для React Native
RCT_EXTERN_METHOD(initialize:(NSString *)clientId
                  partnerName:(NSString *)partnerName
                  themeColorLight:(NSString *)themeColorLight
                  themeColorDark:(NSString *)themeColorDark
                  partnerProfileUrl:(NSString *)partnerProfileUrl
                  isShowErrorOnMain:(BOOL)isShowErrorOnMain
                  standType:(NSString *)standType)

RCT_EXTERN_METHOD(auth:(NSString *)scope
                  state:(NSString *)state
                  nonce:(NSString *)nonce
                  redirectUri:(NSString *)redirectUri
                  ssoBaseUrl:(NSString *)ssoBaseUrl
                  codeChallenge:(NSString *)codeChallenge
                  codeChallengeMethod:(NSString *)codeChallengeMethod
                  loginHint:(NSString *)loginHint)

RCT_EXTERN_METHOD(loginWithIDWeb:(NSString *)scope
                  state:(NSString *)state
                  nonce:(NSString *)nonce
                  redirectUri:(NSString *)redirectUri
                  ssoBaseUrl:(NSString *)ssoBaseUrl
                  codeChallenge:(NSString *)codeChallenge
                  codeChallengeMethod:(NSString *)codeChallengeMethod
                  loginHint:(NSString *)loginHint
                  svcRedirectUrlString:(NSString *)svcRedirectUrlString
                  completion:(RCTResponseSenderBlock)completion)

RCT_EXTERN_METHOD(logout)

RCT_EXTERN_METHOD(autoAuth:(NSString *)scope
                  state:(NSString *)state
                  nonce:(NSString *)nonce
                  redirectUri:(NSString *)redirectUri
                  ssoBaseUrl:(NSString *)ssoBaseUrl
                  codeChallenge:(NSString *)codeChallenge
                  codeChallengeMethod:(NSString *)codeChallengeMethod
                  loginHint:(NSString *)loginHint
                  completion:(RCTResponseSenderBlock)completion)

RCT_EXTERN_METHOD(setClientID:(NSString *)clientId)

RCT_EXTERN_METHOD(sendOtherAuth:(NSString *)nameAuthService
                  isSuccess:(BOOL)isSuccess
                  isUserNew:(BOOL)isUserNew)

RCT_EXTERN_METHOD(setUserID:(NSString *)userID)

RCT_EXTERN_METHOD(checkAppTokenForValid:(RCTResponseSenderBlock)completion)

RCT_EXTERN_METHOD(updateAppToken:(NSString *)scope
                  clientId:(NSString *)clientId
                  state:(NSString *)state
                  nonce:(NSString *)nonce
                  redirectUri:(NSString *)redirectUri
                  codeChallenge:(NSString *)codeChallenge
                  codeChallengeMethod:(NSString *)codeChallengeMethod
                  completion:(RCTResponseSenderBlock)completion)

RCT_EXTERN_METHOD(goToPartnerSSO:(NSString *)partnerWebLink
                  partnerClientId:(NSString *)partnerClientId
                  partnerColor:(NSString *)partnerColor
                  openIn:(NSString *)openIn
                  completion:(RCTResponseSenderBlock)completion)

RCT_EXTERN_METHOD(subscribeToAnalytic:(RCTResponseSenderBlock)completion)

RCT_EXTERN_METHOD(setUIMode:(NSString *)uiModeString)

RCT_EXTERN_METHOD(setCustomFonts:(NSNumber *)mediumResID
                  semiBoldResID:(NSNumber *)semiBoldResID
                  completion:(RCTResponseSenderBlock)completion)

RCT_EXTERN_METHOD(subscribeToAppTokenEvents:(RCTResponseSenderBlock)completion)

@end
